package cn.caidabao.camunda_demo.util.show;

import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author cjn
 * @since 2024-07-17 15:26
 */
@Component
@AllArgsConstructor
public class UserConverter extends ContentFieldConverter{

    @Override
    public Map<String, Object> convert(List<Object> params) {
        Set<String> userIds = params.stream().map(String::valueOf).collect(Collectors.toSet());
        Map<String,Object> res = new HashMap<>();
        for (String userId : userIds) {
            res.put(userId,"未知用户名");
        }
        return res;
    }
}
